public class MethodTwo {
    public static void main(String[] args) throws InterruptedException {
        Student student = new Student();
        Thread thread = new Thread(new MyRunnable(student));
        thread.start();
        // 获取子线程的返回值：Thread的join方法来阻塞主线程，直到子线程返回
        thread.join();//如果把这句代码注掉，主线程将获取不到student.getName()返回值
        System.out.println(student.getName());
    }
}
